import type { themeConfigState, themeMouldState } from '@/types/stores/theme'

import mould1 from '@/common/theme/mould1'
import mould2 from '@/common/theme/mould2'
import mould3 from '@/common/theme/dark'
import { cloneDeep } from 'lodash-es'
import CommonConstants from '@/common/constants/CommonConstants'

const list: themeMouldState[] = [mould1, mould2, mould3]
export default list

export function getThemeConfirg(name: string): themeConfigState {
  const info: themeMouldState | undefined = list.find((el: themeMouldState) => {
    return el.name === name
  })
  if (info) {
    return cloneDeep(info.themeConfig)
  } else {
    return cloneDeep(list[CommonConstants.DEFAULT_THEME].themeConfig)
  }
}
